using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.InputSystem;

public class PlayerGoundState : State
{
    public PlayerGoundState(Player _player, string _Animname, StateMachine _stateMachine) : base(_player, _Animname, _stateMachine)
    {
    }


    public override void Enter()
    {
        base.Enter();
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void Update()
    {
        base.Update();

    }

    public void Jump(InputAction.CallbackContext context)
    {
        if (Player.isGroundDetected() && !Player.isInteract)
        {
            StateMachine.ChangeState(Player.JumpState);
        }
        if (Player.CouldJumpAgain)
        {
            StateMachine.ChangeState(Player.JumpState);
        }
    }

    public void Interaction(InputAction.CallbackContext context)
    {
        if (Player.canInteract)
        {   
            Player.coll.GetComponent<IInteractable>().Interact();
        }
    }


    public void Task(InputAction.CallbackContext context)
    {
        /*if (Player.canTaskTrigger)
        {
            EventHandler.CallUpdateTaskUI(TaskManager.Instance.taskDataList.GetTaskDetail(Player.targetTaskID));
        }*/

    }
    


}
